\documentclass[tikz,10pt,border=10pt]{standalone}
\usepackage{textcomp}
\usepackage{xcolor}
\usetikzlibrary{shapes,arrows}
\begin{document}
\tikzset{%
  state/.style    = {draw, thick, rectangle, node distance = 6cm}
}
\newcommand{\CA}[1]{\it{A} \textcolor{black}{\textsc{#1}}}
\newcommand{\CB}[1]{\it{B} \textcolor{black}{\textsc{#1}}}
\newcommand{\CS}[2]{\begin{tabular}{l}
\CA{#1} \\
\CB{#2}
\end{tabular}}

\begin{tikzpicture}[auto, thick, node distance=2cm, >=triangle 45]
\draw
	node [state, name=start, right = 0.5mm] {\CS{Unsent}{Unreceived}}
  node [state, right of=start] (send) {\CS{Sent}{Unreceived}}
  node [state, right of=send] (recv) {\CS{Sent}{Received}}
  node [state, below of=send] (timeout) {\CS{Sent,TimedOut}{Unreceived}}
  node [state, right of=timeout] (timeoutfinal) {\CS{Sent,TimedOut}{TimedOut}};

  \draw node [state, name = key, right = 18cm, above = 2mm] {\begin{tabular}{l}
  \it{Key} \\
  \textcolor{blue}{Standard Flow} \\
  \textcolor{red}{Timeout Flow} \\
  \end{tabular}};

	\draw[->, blue](start) edge node[yshift=3mm, xshift=1mm] {\textsc{sendPacket}} (send);
  \draw[->, blue](send) edge node {\textsc{recvPacket}} (recv);

  \draw[->, red](send) edge node {\textsc{timeoutPacket}} (timeout);
  \draw[->, red](timeout) edge node {\textsc{recvTimeoutPacket}} (timeoutfinal);

	\draw[color=black,thick](-1.5,-8) rectangle (20,2);

	\node at (-0.5,1.5) [above=0.5mm, right=5mm] {\huge{\textsc{Packet State Machine}}};

\end{tikzpicture}
\end{document}
